1. Field of the Invention
The invention relates to an image processing method and an image processor for compressing and restoring color data.
2. Description of the Related Art
The color image has a huge size of data regarding colors. When the color data is displayed or transferred, it is used to apply the method of compressing the data size by approximating the color number of original color data with less color number.
As such method for compressing of color image, a method disclosed in Japanese Laid-open publication No. 61-252792 is well known. In the method, the red signal R, the green signal G and the blue signal B are independently handled one another. The method is explained hereinafter according to FIGS. 28 and 24. The image processor applying the method is provided with input means 2300a, 2300b and 2300c for each color of image independently, as shown in FIG. 29. Each of color data inputted through the input means 2300a, 2300b and 2300c is given to front-coding means 2301a, 2301b and 2031c. Each of the front-coding means 2301a, 2301b and 2301c calculates an average of color data. Based on the average, a specific block on color image is divided into two regions. Further, Data of pixels in the respective divided regions gets evened and thereby two representative values are calculated. According to the above processing, the block is divided into two regions in each color, and two representative values are calculated per color. By combining three colors of RGB, the region is divided into eight, two to the second power. And eight representative colors can be obtained, which represents the divided eight regions. Back-coding means 2302 detects the appearance frequency of eight colors in the block, and then extracts two colors among the eight colors as the representative colors of color data in the block. The obtained two representative colors are sent to decoding means 2303 via a communication medium or an interface like the Internet together with position information for approximating the pixel data in image with those representative colors. The decoding means 2303 prepares restored image by embedding the representative color in a specific pixel coordinates, and the restored image is outputted by output means 2304a, 2304b and 2304c. 
Besides, the method of calculating the representative color by applying principal component analysis to RGB signals is also well known as another method, which is disclosed in Japanese Laid-open Publication No. 01-264092, for example. In this method, the colors (principal component colors) representing a specific block are determined according to the correlation among the RGB signals, and the block is divided according to the principal component colors, thereby the colors in the block are approximated with a specific number of colors.
However, the method disclosed in the Japanese Laid-open Publication No. 61-252792 handles respective RGB signals independently and gives no consideration to the correlation among the respective colors, so that it is easy to generate distortions on the restored image and impossible to obtain a good result in SN ratio (Signal to Noise Ratio) of evaluating the distortion degree quantitatively. Such problems have been noted frequently.
On the other hand, the principal component analysis used in the Japanese Laid-open Publication No. 01-264092 has the following problems. It is afraid that, since the principal component analysis requires the multidimensional matrix calculation in order to calculate the correlation among RGB signals, the amount of processing increases and it makes the hardware scale such as processing circuits bigger. Additionally, when the method was designed by the software processing using CPU and the like, it needs much calculation time.